home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / plnk081.zip / pilot-link.0.8.1 / include / pi-file.h < prev    next >
C/C++ Source or Header  |  1997-06-20  |  2KB  |  59 lines

  1. #ifndef _PILOT_FILE_H_
  2. #define _PILOT_FILE_H_
  3.  
  4. #include "pi-args.h"
  5.  
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9.  
  10. /* For DBInfo */
  11. #include "pi-dlp.h"
  12.  
  13. typedef unsigned long pi_uid_t;
  14.  
  15. struct pi_file; /* forward declaration */
  16.  
  17. /* most functions return -1 for error, 0 for ok */
  18.  
  19. /* read-only open */
  20. extern struct pi_file *pi_file_open PI_ARGS((char *name));
  21.  
  22. /* closes read or write handle */
  23. extern int pi_file_close PI_ARGS((struct pi_file *pf));
  24.  
  25. extern int pi_file_get_info PI_ARGS((struct pi_file *pf, struct DBInfo * infop));
  26. extern int pi_file_get_app_info PI_ARGS((struct pi_file *pf, void **datap, int *sizep));
  27. extern int pi_file_get_sort_info PI_ARGS((struct pi_file *pf, void **dadtap, int *sizep));
  28. extern int pi_file_read_resource PI_ARGS((struct pi_file *pf, int idx,
  29.                void **bufp, int *sizep, unsigned long *type, int *idp));
  30. extern int pi_file_read_record PI_ARGS((struct pi_file *pf, int idx,
  31.              void **bufp, int *sizep, int *attrp, int * catp, pi_uid_t *uidp));
  32. extern int pi_file_get_entries PI_ARGS((struct pi_file *pf, int * entries));
  33. extern int pi_file_read_record_by_id PI_ARGS((struct pi_file *pf, pi_uid_t uid,
  34.                    void **bufp, int *sizep, int *idxp,
  35.                    int *attrp, int * catp));
  36. extern int pi_file_id_used PI_ARGS((struct pi_file *pf, pi_uid_t uid));
  37.  
  38. extern struct pi_file *pi_file_create PI_ARGS((char *name, struct DBInfo * info));
  39.  
  40. /* may call these any time before close (even multiple times) */
  41. extern int pi_file_set_info PI_ARGS((struct pi_file *pf, struct DBInfo * infop));
  42. extern int pi_file_set_app_info PI_ARGS((struct pi_file *pf, void *data, int size));
  43. extern int pi_file_set_sort_info PI_ARGS((struct pi_file *pf, void *data, int size));
  44.  
  45. extern int pi_file_append_resource PI_ARGS((struct pi_file *pf, void *buf, int size,
  46.                 unsigned long type, int id));
  47. extern int pi_file_append_record PI_ARGS((struct pi_file *pf, void *buf, int size,
  48.                int attr, int category, pi_uid_t uid));
  49.                  
  50. extern int pi_file_retrieve PI_ARGS((struct pi_file * pf, int socket, int cardno));
  51. extern int pi_file_install PI_ARGS((struct pi_file * pf, int socket, int cardno));
  52. extern int pi_file_merge PI_ARGS((struct pi_file * pf, int socket, int cardno));
  53.  
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57.  
  58. #endif
  59.